.diff-container {
  width: 100%;
  height: 600px; /* 固定高度以支持虚拟滚动 */
  overflow-y: auto;
  position: relative;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

/* 差异统计信息样式 */
.diff-stats {
  background-color: #e3f2fd;
  padding: 15px;
  border-bottom: 1px solid #bbdefb;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.diff-stats h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #1565c0;
  font-size: 18px;
}

.diff-stats h4 {
  margin-top: 15px;
  margin-bottom: 8px;
  color: #2196f3;
  font-size: 16px;
}

.stats-info {
  margin-bottom: 15px;
}

.stats-info p {
  margin: 5px 0;
  font-size: 14px;
  line-height: 1.5;
}

.debug-info {
  background-color: #f1f8e9;
  padding: 10px;
  border-radius: 4px;
  border-left: 4px solid #8bc34a;
}

.debug-info p {
  margin: 3px 0;
  font-size: 12px;
  font-family: monospace;
  color: #333;
}

.error-text {
  color: #f44336 !important;
  font-weight: bold;
}

.raw-diff-preview {
  background-color: #f5f5f5;
  padding: 15px;
  margin-top: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.raw-diff-preview h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #666;
}

.raw-diff-preview pre {
  margin: 0;
  padding: 10px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 优化大型diff的性能 */
.d2h-file-wrapper {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.d2h-code-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 2px 8px;
  margin: 0;
}

/* 差异行样式优化 */
.d2h-ins {
  background-color: #dfd;
  border-left: 3px solid #28a745;
}

.d2h-del {
  background-color: #fdd;
  border-left: 3px solid #dc3545;
}

.d2h-file-header {
  background-color: #f7f7f7;
  padding: 8px 16px;
  border-bottom: 1px solid #e0e0e0;
  font-weight: bold;
}

/* 错误提示样式 */
.error {
  color: #dc3545;
  padding: 20px;
  text-align: center;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin: 20px;
}

/* 滚动条优化 */
.diff-container::-webkit-scrollbar {
  width: 8px;
}

.diff-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.diff-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.diff-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 加载更多按钮悬停效果 */
#loadMoreBtn:hover {
  background-color: #e0e0e0;
  transition: background-color 0.3s;
}

/* 合并差异视图样式 */
.merged-diff-summary {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.merged-diff-info {
  margin-bottom: 20px;
}

.merged-diff-info p {
  margin: 10px 0;
  color: #666;
  font-size: 14px;
}

.merged-diff-info strong {
  color: #dc3545;
  font-size: 16px;
}

.merged-diff-actions {
  margin-bottom: 20px;
  text-align: center;
}

.view-full-diff-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.view-full-diff-btn:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.view-full-diff-btn:active {
  transform: translateY(0);
}

.merged-diff-preview {
  background-color: white;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 15px;
}

.preview-header {
  font-weight: 600;
  margin-bottom: 10px;
  color: #212529;
  font-size: 14px;
}

.simplified-diff {
  margin: 0;
  padding: 10px;
  background-color: #f6f8fa;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #212529;
  overflow-x: auto;
}

/* 文件统计信息样式 */
.d2h-file-stats {
  margin-left: auto;
  display: flex;
  gap: 15px;
}

.d2h-lines-added {
  color: #28a745;
  font-weight: 600;
}

.d2h-lines-deleted {
  color: #dc3545;
  font-weight: 600;
}